﻿@{
    Layout = "~/Views/Shared/_LayoutPageEmpty.cshtml";
}
@model ForgetPassword
<div class="l-regist-top bgc8">
    <div class="l-regist-head c1">
        <h1 class="l-regist-logo">乐订货</h1>
        <span class="l-regist-line"></span>
        <span class="l-regist-title f-s3">忘记密码</span>
    </div>
</div>

<div class="l-regist bgc1">    
    <div class="l-m-form l-regist-form">
        <form mark="LedinghuoForm" action="@Url.Action("ForgetPassword")" method="POST">
            @Html.LTextEditFor("LoginNo", "用户名",Model.LoginNo, new { placeholder = "用户名", @class = "inp-text bc1 bgc0 inp-lg7 inp-hg8" }, new { req = new { message = "请输入用户名" } }, null)
            @Html.LTextEditFor("Mb", "手机号",Model.Mb, new { placeholder = "手机", @class = "inp-text bc1 bgc0 inp-lg7 inp-hg8" }, new { req = new { message = "请输入手机验证码" },phone=new{message="手机号格式错误"} }, null)
            <div class="form-item">
                <div class="label c5">短信验证码</div>
                <div class="content">
                    @Html.LTextEdit("ValidateCode",Model.ValidateCode, new { @class = "inp-text bc1 bgc0 inp-lg7 inp-hg8", placeholder = "短信验证码" }, new { req = new { message = "短信验证码不能为空" } }, new { title = "填写手机收到的验证码" })
                    <a href="javascript:void(0)" id="SendCode" class="l-btn submit btn-lg4 btn-hg8 absolute getcode bgc0 bc1 c7 f-s1">获取验证码</a>
                </div>
            </div>
            <div class="form-item form-btnitem">
                <a href="javascript:void(0)" class="l-btn submit btn-lg5 btn-hg8" type="submit" tag="button">下一步</a>
            </div>
            @Html.LPageError()
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $("#SendCode").bind("click", function () {
            var $this = $(this);
            if ($this.hasClass("disable")) {
                return;
            }
            var $MB = $("#Mb");
            var mb = $.trim($MB.val());
            if ($MB.data("result") == undefined) {
                $MB.input().doVerification();
            }
            if (!$MB.data("result").result) return;

            $.lajax({
                url: "@Url.Action("SendCode", "Regist")",
                params: { mb: mb },
                callback: function(ret) {
                    if (ret) {

                    }
                }
            });
            $this.addClass("disable");

            var i = 60;
            var timer = function() {
                var n = i--;
                $this.html(n + "秒后重新获取");
                if (n == 0) {
                    $this.removeClass("disable").html("获取验证码");
                    return;
                }
                setTimeout(timer, 1000);
            }
            timer();
        });
    });
</script>
